import React, { Component } from 'react'

export class Title extends Component {
    render() {
        const {list,leftid, del,onchangetitle}=this.props
        return (
            <div className='title'>
                
                <ul>
                    {
                       list.length ?list.map((item)=>{
                           return item.flag ?<li
                           key={item.id} className={item.id===leftid ? 'on' :''} onClick={
                               ()=>{
                                onchangetitle(item.id)

                               }
                           }>
                               <span>{item.title}</span>
                               <b onClick={
                                   ()=>{
                                       del(item.id)
                                   }
                               }>x</b> 
                               </li> :null
                       })   :'暂无数据'
                    }
                    {/* <li className='on'><span>0001</span><b>❌</b></li>
                    <li><span>0002</span><b>❌</b></li>
                    <li><span>0003</span><b>❌</b></li>
                    <li><span>0004</span><b>❌</b></li>
                    <li><span>0005</span><b>❌</b></li>
                    <li><span>0006</span><b>❌</b></li>
                    <li><span>0007</span><b>❌</b></li>
                    <li><span>0008</span><b>❌</b></li>
                    <li><span>0009</span><b>❌</b></li>
                    <li><span>0010</span><b>❌</b></li> */}
                </ul>
            </div>
        )
    }
}

export default Title